package com.bdqn.t382.entity;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Pet {
    // 宠物
    public Pet() {
    }

    private String name; // 宠物名
    private int age; //宠物年龄

    // 自我介绍
    public void introduce() {
        System.out.println("我是'" + this.name + "'，今年" + this.age + "岁");
    }

    private static final Logger LOGGER = LoggerFactory.getLogger(Pet.class);

    public void setAge(int age) {
        // 如果setAge被调用，则输出日志
        LOGGER.debug("Pet对象的setAge方法被调用！参数age = {}", age);
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }
}
